#! /bin/bash

typeset -i cnt=0
rm -f tmp

if [ "a$1" = "a" ] ;then
	for i in *.[ch]* ;do
		this=`egrep -c -v  ^+$ $i`
		echo $i: $this >>tmp
		cnt=cnt+this
	done	
else
	for i in $1 ;do
		this=`egrep -c -v  ^+$ $i`
		echo $i: $this >>tmp
		cnt=cnt+this
	done
fi


column -t tmp 2>/dev/null
echo --------------------------
echo code lines count:   $cnt

